package IC.lir.instructions;

public class LibraryInstruction extends Instruction {
	
	private Operand[] ops;
	private Label functionLB;
	private Register r;

	//C'tor
	public LibraryInstruction(String functionName, Register r, Operand... ops) {
		this.ops = ops;
		this.functionLB = new Label("__" + functionName);
		this.r = r;
	}
	
	@Override
	public String toString() {
		StringBuffer s = new StringBuffer();
		s.append("Library " + functionLB + "(");
		for (int i = 0; i < ops.length; i++) {
			s.append(ops[i]);
			if (i+1 < ops.length) {
				s.append(", ");
			}
		}
		s.append(")," + r);
		return s.toString();
	}
	
}